package com.example.design.service;

import com.example.design.bo.PaymentBody;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author Hong Qiang
 * @Date 2023/3/27 14:32
 * @Version 1.0
 */
public class PaymentContext {

    @Resource
    private IPayment paymentStrategy;

    public PaymentContext(IPayment paymentStrategy) {
        this.paymentStrategy = paymentStrategy;
    }

    public Boolean pay(PaymentBody paymentBody) {
        return this.paymentStrategy.pay(paymentBody);
    }
}
